BEGIN;

ALTER TABLE DUTY.DUTYRECORDS ADD COLUMN worktimesecond BIGINT;
ALTER TABLE DUTY.DUTYRECORDS ADD COLUMN overtimesecond BIGINT;

UPDATE DUTY.DUTYRECORDS SET worktimesecond=worktimems/1000 WHERE worktimems IS NOT NULL AND worktimesecond IS NULL;
UPDATE DUTY.DUTYRECORDS SET overtimesecond=overtimems/1000 WHERE overtimems IS NOT NULL AND overtimesecond IS NULL;

COMMIT;